package com.kfm.pm;

public class Demo06 {

    public static void main(String[] args) {
        // 找到最小的值 以及 最小值所在的下标
        int[] arr = {15, 9000, 10000, 20000, 9500, -5};
        int min = arr[0];
        int minIndex = 0;
        for (int i = 1; i < arr.length; i ++) {
            if (arr[i] < min) {
                min = arr[i];
                minIndex = i;
            }
        }
        System.out.println("最大值是" + min);
        System.out.println("最大值下标是" + minIndex);
    }
}
